<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta charset='UTF-8'>
  <title> new document </title>
  <style type="text/css">
	div{ border:solid 2px red; }
	.name{ width:400px; height:300px; color:red; font-size:100px;}
  </style>
 </head>
 <body>
	<!--<button onclick="console.log('事件内');">事件</button>
	<a href="javascript:alert('警告');">伪链接</a>
	<script type="text/javascript" src="t2.js">
		
	</script>
	-->
	
	<input id='inp'  value="输入框默认值"/>
	<button id='but'>按钮</button>
	<button id='but2'>qc按钮</button>
	<div id="div">DIV</div>
	<script type="text/javascript">
		

		
		/*var body = document.body;
		alert(body.innerHTML);*/
		var body = document.body;
		var but = document.getElementById('but');
		var but2 = document.getElementById('but2');
		var div = document.getElementById('div');
		var i = 1;
		but.onclick = function(){
			//div.className = 'name';
			/*div.style.cssText = 'width:400px; height:300px; color:red;';*/
			//div.style.width/*heigh color*/ = '400px';
			//var inp = document.createElement('input');
			//var div = document.createElement('div');
			var nb = document.createElement('button');
		 	nb.innerHTML = '新按钮'+i++;
			//nb.onclick = function qc(){
				//this.parentNode.removeChild(nb/*this*/);
			//}
			div/*body(y\元素)*/.appendChild(nb);
			
		}
		but2.onclick = qc();
		
		//document.write('世界你好');
		/*var inp = document.getElementById('inp');
		but.onclick = function(){
			//input.value="新值"; 
			alert(inp.value);
		}*/

		/*var but = document.getElementById('but');
		but.onclick = function(){
			console.log(这是按钮);
		}
		*/
		
		/*var div = document.getElementById('div');
		but.onclick = function(){
			alert(div.innerHTML);
		}
		*/
		/*var b = confirm('提示框');
		if(b){
			alert('这是确定');
		}else{
			alert('这是取消');
		}*/
		/*var star = prompt('用户输入内容：','默认内容');
		alert('输入的是：'+star);*/
		var  i = '2.3';
		alert(parseInt(i));
		//alert(parseFloat(i));
		/*var i = '5.2';
		var w = '5.2a';
		alert(isNaN(i));
		alert(isNaN(w));*/


		/*var a = 5;
			for(var i=0;i<a;i++){
				for(var r=0;r<=i;r++){
					console.log('*');
				}
				console.log('\n');
			}
		*/
		
		/*for(var a=1;a<10;a++){
			for(var b=1;b<=a;b++){
				console.log(a+"*"+b);
			}console.log("\n");
		}	*/

		/*var a = 2;
		while(a<13){
			console.log(a);
			a+=2;
		}*/
		/*do{
			console.log('b');
		} while(
			false
		);*/
		/*function fun(a,b){
			console.log("结果："+(a+b));
		}
		;
		//fun(1,3);
		alert('fun(1,2)');*/
		/*var i = 1;
			i+= 1;
			i++;
			i+=10;
		function fun(){
			i-=5;
			i--;
			i-=2;
		}
		fun();
		console.log(i)*/
		/*var a=2;
		var b=3;
		b*=3;
		console.log(b);*/
		/*
		var a =[5,15,25,35];
		for(var i=0;i<=a.length;i++){
			console.log(a[i]);
		}*/
		
	</script>
 </body>
</html>
